package bjut.zrpc.test.listener;

import bjut.zrpc.core.optimization.factory.SingletonFactory;
import bjut.zrpc.core.optimization.netty.NettyServer;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;


/**
 * @Author: zhuzhiming
 * @Date: 2022/6/25 14:37
 */
@Component
public class NettyListener implements ApplicationListener<ContextRefreshedEvent> {
    @Override
    public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) {
        NettyServer nettyServer = SingletonFactory.getInstance(NettyServer.class);
        nettyServer.start();
    }
}
